package com.lag.service;

import com.lag.spring.Autowired;
import com.lag.spring.BeanNameAware;
import com.lag.spring.Component;
import com.lag.spring.InitializingBean;

@Component
public class OrderService implements BeanNameAware, InitializingBean {
    @Autowired
    private UserService userService;

    private String beanName;

    public void test(){
        System.out.println("userService:" + userService);
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() {
        // ..... 其它逻辑
        System.out.println("[" + beanName + "]初始化");
    }
}
